<footer id="footer">
    <div class="footer-content">
        <div class="left">
            <div class="title">关于我们</div>
            <div class="about-wrap">
                <a class="feedback" href="javascript:">意见反馈</a>
                <a href="javascript:">商务合作</a>
                <a href="javascript:">我要报道</a>
                <a href="javascript:">关于我们</a>
                <a href="javascript:">我要投稿</a>
                <a href="javascript:">联系我们</a>
                <a class="mobile" href="javascript:">
                  手机网站
                  <div class="logo">
                    <img src="/web/img/m.png" alt="">
                  </div>
                </a>
                <a href="javascript:">加入我们</a>
            </div>
        </div>
        <div class="right">
            <div class="title">易采通app下载</div>
            <img src="/web/img/qr-code-yicaitong.png" alt="易采通app">
            <div class="explain">IOS&Android</div>
        </div>
        <div class="middle">
            <div class="title">友情链接 >></div>
            <div class="link-wrap">
                <a href="javascript:">广东省政府采购</a>
                <a href="javascript:">广东省政府采购</a>
                <a href="javascript:">广东省政府采购</a>
                <a href="javascript:">广东省政府采购</a>
                <a href="javascript:">广东省政府采购</a>
                <a href="javascript:">广东省政府采购</a>
                <a href="javascript:">广东省政府采购</a>
                <a href="javascript:">广东省政府采购</a>
                <a href="javascript:">广东省政府采购</a>
                <a href="javascript:">广东省政府采购</a>
                <a href="javascript:">广东省政府采购</a>
                <a href="javascript:">广东省政府采购</a>
                <a href="javascript:">广东省政府采购</a>
                <a href="javascript:">广东省政府采购</a>
                <a href="javascript:">广东省政府采购</a>
                <a href="javascript:">广东省政府采购</a>
            </div>
        </div>
        <hr>
        <ul class="substation">
          <li>
            <a href="###" traget="_blank">广东省政府采购</a>
          </li>
          <li>
            <a href="###" traget="_blank">广东省政府采购</a>
          </li>
          <li>
            <a href="###" traget="_blank">广东省政府采购</a>
          </li>
          <li>
            <a href="###" traget="_blank">广东省政府采购</a>
          </li>
          <li>
            <a href="###" traget="_blank">广东省政府采购</a>
          </li>
          <li>
            <a href="###" traget="_blank">广东省政府采购</a>
          </li>
          <li>
            <a href="###" traget="_blank">广东省政府采购</a>
          </li>
          <li>
            <a href="###" traget="_blank">广东省政府采购</a>
          </li>
          <li>
            <a href="###" traget="_blank">广东省政府采购</a>
          </li>
          <li>
            <a href="###" traget="_blank">广东省政府采购</a>
          </li>
          <li>
            <a href="###" traget="_blank">广东省政府采购</a>
          </li>
          <li>
            <a href="###" traget="_blank">广东省政府采购</a>
          </li>
        </ul>
        <hr>
        <div class="copyright">
            <img src="/web/img/logo-footer.png" alt="logo">
            <span>Copyright @1999-2020 政府采购信息网 京ICP备09018988号-3  京公网安备 11010502030129号  京B2-201  网站地图  RSS订阅  Tag标签</span>
        </div>
    </div>
</footer>

<!--意见反馈 start-->

<!--<link rel="stylesheet" href="/web/lib/bootstrap.css">-->
<!--<link rel="stylesheet" href="/web/lib/bootstrap-select.min.css">-->

<script src="/web/lib/bootstrap.min.js"></script>
<script src="/web/lib/bootstrap-select.min.js"></script>
<div id="feedback-mask" class="">
    <div class="mask"></div>
    <div class="content-wrap">
        <div class="title">
            意见反馈
            <i class="iconfont icon-guanbi"></i>
        </div>
        <div class="content">
            <div class="item type must-input">
                <div class="item-title">反馈类型：</div>
                <div class="value">
                    <select class="selectpicker-feedback" data-error-sign="请选择"></select>
                </div>
            </div>
            <div class="item intro must-input">
                <div class="item-title">问题描述：</div>
                <div class="value">
                    <textarea name="" id="textarea-intro" placeholder="请尽可能详细说明您遇到的问题"></textarea>
                    <span class="input-limit">0/500</span>
                </div>
            </div>
            <div class="item contact must-input">
                <div class="item-title">联系方式：</div>
                <div class="value">
                    <input type="text" placeholder="手机/微信/QQ/邮箱，方便我们与您联系">
                    <span class="input-limit">0/30</span>
                </div>
            </div>
            <div class="btn-submit">提交</div>
        </div>
    </div>
    <script>
        $.ajax({
            url:ports.getFeedbackType,
            success:function (res) {
                if(res.status == 200){
                    var $typeSelect = $('#feedback-mask .content .item.type .selectpicker-feedback');
                    $.each(res.data,function (i,item) {
                        // console.log($typeSelect)
                        $typeSelect.append('<option value='+ item.constantId +'>'+ item.constantName +'</option>')
                    })
                    $('.selectpicker-feedback').selectpicker({});
                }

            }
        })
        $('footer .about-wrap a.feedback').click(function () {
            var linkBootstrap = '<link class="bootstrap-css" rel="stylesheet" href="/web/lib/bootstrap.css">'
            var linkBootstrapSelect = '<link class="bootstrap-select" rel="stylesheet" href="/web/lib/bootstrap-select.min.css">'
            $('title').after(linkBootstrap).after(linkBootstrapSelect);
            $.ajax({
                url: ports.verifyToken,
                success: function (res) {
                    console.log('验证token是否有效', res);
                    if (res.status == 200) {
                        if (!res.data) {
                            window.location.replace(globalUrl.login + "?returnUrl=" + encodeURIComponent(window.location.href))
                        }else {
                            var timer = setInterval(function () {
                                console.log($('.bootstrap-select.btn-group .dropdown-menu').css('z-index'))
                                if($('.bootstrap-select.btn-group .dropdown-menu').css('z-index')!='auto'){
                                    clearInterval(timer);
                                    $('#feedback-mask').addClass('active');
                                }
                            },10)
                        }
                    }
                }
            })

        })
        $('#feedback-mask .icon-guanbi').click(function () {
            $('#feedback-mask').removeClass('active');
            $('link.bootstrap-css').remove();
            $('link.bootstrap-select').remove();

        });
        // var selectTypePass = false,textareaIntroPass = false,inputContactPass = false;
        $('#feedback-mask .selectpicker-feedback').change(function () {
            // selectTypePass = $(this).val() != '0';
            canSubmit()
        })
        $('#textarea-intro').on('input',function () {
            // textareaIntroPass = !!$(this).val().trim();
            var val = $(this).val().trim();
            if(val.length>500){
                $(this).addClass('error')
            }else {
                $(this).removeClass('error');
            }
            $(this).next().html(val.length+'/'+500);
            canSubmit()
        })
        $('#feedback-mask .contact input').on('input',function () {
            // inputContactPass = !!$(this).val().trim();
            var val = $(this).val().trim();
            if(val.length>30){
                $(this).addClass('error');
            }else {
                $(this).removeClass('error');
            }
            $(this).next().html(val.length+'/'+30);
            canSubmit()
        })
        function canSubmit() {
            var selectTypePass = $('#feedback-mask .selectpicker-feedback').val() != '0',
                textareaIntroPass = $('#textarea-intro').val().trim()&&$('#textarea-intro').val().trim().length<=500,
                inputContactPass = $('#feedback-mask .contact input').val().trim()&&$('#feedback-mask .contact input').val().trim().length<=30;
            if(selectTypePass&&textareaIntroPass&&inputContactPass){
                $('#feedback-mask .btn-submit').addClass('active');
            }else {
                $('#feedback-mask .btn-submit').removeClass('active');
            }
        }
        $('#feedback-mask .btn-submit').click(function () {
            if($(this).hasClass('active')){
                $.ajax({
                    url:ports.submitFeedback,
                    data:{
                        feedbackType:$('#feedback-mask .selectpicker-feedback').val(),
                        briefIntro:$('#feedback-mask .intro textarea').val().substr(0,500),
                        contactInformation:$('#feedback-mask .contact input').val().substr(0,30)
                    },
                    success:function (res) {
                        console.log('提交意见反馈',res)
                        if(res.status == 200){
                            $('#feedback-mask').removeClass('active');
                            $('link.bootstrap-css').remove();
                            $('link.bootstrap-select').remove();

                            //提交成功后清空表单信息
                            $('#feedback-mask .selectpicker-feedback').val('0');
                            $('.dropdown-menu.inner>li').removeClass('selected');
                            $("li[data-original-index='0']").addClass('selected');
                            $('button.dropdown-toggle').prop('title','请选择');
                            $('button.dropdown-toggle .filter-option').text('请选择');
                            $('#textarea-intro').val('');
                            $('#feedback-mask .contact input').val('');
                            $('#feedback-mask .btn-submit').removeClass('active');

                            utils.showModal({
                                content:'小编已收到您的信息，<br>感谢您对政府采购信息网的支持！'
                            });
                        }

                    }
                })
            }
        })
    </script>
</div>
<!--意见反馈 end-->